[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
OBJECT  new object creation:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Syntax:
~~~~~~~

  [Visibility] OBJECT [<VarName>] OF <Class> [INIT [InitMethod( [list] )]]

 where:

  Visibility can be LOCAL or STATIC or PUBLIC or PRIVATE

  InitMethod(...) can be: Function( [list] )
                      or: <VarName>:VirtualMethod( [list] )

Description:
~~~~~~~~~~~~
New object of the class is created, the initial instvar values are set
(method o:New()) and in the case of use of INIT it is initialised by o:Init().
If the InitMethod([list]) is set it is performed too.
Have a look to:
Basic concept .. Simple object manipulating demo


Example:
~~~~~~~~
  LOCAL OBJECT o1 OF Class1
  new local object o1 of Class1 is created, its variables are initialised
  by standard constructor method o:New().

  STATIC OBJECT o2 OF Class2 INIT
  new static object o2 of Class2 is created and constructor o:New() and
  virtual method o:Init() is called for it.

  PUBLIC OBJECT o3 OF Class3 INIT PostInit(), o3:Load()
  new public object o3 of Class3 is created and constructor o:New() and
  virtual method Init(), and static method  PostInit() and virtual method
  Load() is called for it. This command can be rewritten as

  PUBLIC OBJECT o3 OF Class3  //object creation, constructor o:New() call
  o3:Init()                   //virtual method
  PostInit()                  //function
  o3:Load()                   //virtual method


Source file is Object.ch

See Also: Syntax Simple demo
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson